package util;

public class RecipeUtil {

	public static String recipeDetail(Integer id){
		String url = "http://api.meishi.cc/v6/recipe_detail_new.php?format=json&id="+id;
		return URLUtil.request(url);
	}
	
	public static String shicaiSearch(String keyword){
		String url = "http://api.meishi.cc/v6/shicai_search.php?format=json&keyword="+keyword;
		return URLUtil.request(url);
	}
	
	public static String smartCook(String foodsname, String order, String page, String length){
		StringBuffer url = new StringBuffer();
		url.append("http://api.meishi.cc/v6/smart_cook.php?format=json");
		url.append("&foodsname="+foodsname);
		if(order!=null)
			url.append("&order="+order);
		if(page!=null)
			url.append("&page="+page);
		if(length!=null)
			url.append("&per_page="+length);
		
		return URLUtil.request(url.toString());
	}
}
